#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 55;
int arr[N];
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(arr, 0, sizeof(arr));
		int sum = 0;
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
			sum += arr[i];
		}
		if (sum % 2 == 0) {
			cout << 0 << endl;
			continue;
		}
		int mi = 1e6 + 10;
		for (int i = 0; i < n; i++) {
			int k = arr[i];	
			int ans = 0;
			while (k) {
				ans++;
				k /= 2;
				if (k % 2 != arr[i] % 2) {
					break;
				}
			}
			/*if (k % 2 ==  1) {
				while (k) {
					ans++;
					k /= 2;
				}
			}
			else {
				while (k % 2 != 1) {
					ans++;
					k /= 2;
				}
			}*/
			mi = min(mi, ans);
		}
		cout << mi << endl;
	}
	return 0;
}